<script>
  import {
    launch,
    show
  } from "./lib/index.js"
  export default {
    onLaunch: function(options) {

      // #ifdef MP-WEIXIN
      const updateManager = wx.getUpdateManager()
      updateManager.onCheckForUpdate(function(res) {
        // 请求完新版本信息的回调
        console.log(res.hasUpdate)
      })

      updateManager.onUpdateReady(function() {
        uni.showModal({
          title: '更新提示',
          content: '新版本已经准备好，是否重启应用？',
          success: function(res) {
            if (res.confirm) {
              // 新的版本已经下载好，调用 applyUpdate 应用新版本并重启
              updateManager.applyUpdate()
            }
          }
        })
      })

      updateManager.onUpdateFailed(function() {
        // 新版本下载失败
      })
      // #endif
      launch(this, options);
    },
    onShow(options) {
      show(this, options);
    },
  };
</script>

<style lang="scss">
  /* 引入全局公共css */
  @import "@/common/css/index.scss";

  .uni-easyinput {
    height: 100% !important;

    .uni-easyinput__content {
      border-radius: 36rpx !important;
      box-sizing: border-box !important;

      input:focus {
        outline: none !important;
      }
    }
  }

  .uni-easyinput-head {
    height: 100% !important;
    width: 100% !important;

    .uni-easyinput:focus-within {
      width: 100% !important;
    }

    .uni-easyinput__content {
      border-radius: 36rpx !important;
      box-sizing: border-box !important;
      height: 100% !important;

      .uni-easyinput__content-input {
        height: 100% !important;
      }

      input:focus {
        outline: none !important;

      }
    }
  }
</style>